﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;

namespace JSRunner
{
    /// <summary>
    /// Interaction logic for UserControl1.xaml
    /// </summary>
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }

        public void Go()
        {
            var fs = File.OpenRead("../../a.htm");
            wb.NavigateToStream(fs);
            wb.LoadCompleted += new LoadCompletedEventHandler(wb_LoadCompleted);
        }

        void wb_LoadCompleted(object sender, NavigationEventArgs e)
        {
            Console.WriteLine("wb load completed");
        }
        public object Run(string name)
        {
            var ret = wb.InvokeScript(name);
            return ret;
        }
    }
}
